'''
$author$
$Revision: 22 $
$LastChangedDate: 2007-05-17 18:33:03 +0200 (Thu, 17 May 2007) $
'''

import libsbml
from PyscesCore2 import NewCore
from PyscesCore2Interfaces import SbmlToCore


def getCoreFromSbml(self, d):
    brg = SbmlToCore()
    brg.getSbmlModel(document=d)
    brg.getParsedModel()
    self.c2 = NewCore(brg)
    self.c2.setDescription('Sbml2Core')

# just for testing
def getCoreFromSbmlFile(self, f, d):
    brg = SbmlToCore()
    brg.getSbmlStringFromDisk(f, Dir=d)
    brg.getSbmlModel()
    brg.getParsedModel()
    self.c2 = NewCore(brg)
    self.c2.setDescription('Sbml2Core')
    

def getProtectedAttributes():
    return ['c2']

if __name__ == '__main__':
    c2 = getCoreFromSbmlFile('test_c2_dev.xml', "/home/bgoli/mypysces/dev")
    d = c2.__model__.model
    c3 = getCoreFromSbml(d)
    print 'Type c2:', type(c2)
    print 'Type c3:', type(c3)
    
